package com.zmn.mcc.admin.controller;

import com.zmn.common.dto.LoginStaff;
import com.zmn.manager.shiro.admin.StaffAdminService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.Resource;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Optional;

/**
 * @uthor heguanghua
 * @since 2020/04/09 18:43
 */
public class MccBaseController {
    protected Logger logger = LoggerFactory.getLogger(getClass());

    // region 取得登录凭证或相关信息

    /**
     * 取得登录用户Id
     * @return
     */
    protected Integer getStaffId() {
        return getLoginStaff().getStaffId();
    }

    /**
     * 取得登录用户名称
     * @return
     */
    protected String getStaffName() {
        return getLoginStaff().getRealName();
    }

    /**
     * 取得登录凭证
     * @return
     */
    protected LoginStaff getLoginStaff() {
        return StaffAdminService.currentStaff();
    }
    // endregion

}
